package com.chuangjiangx.member.score.ddd.dal.mapper;

import com.chuangjiangx.member.score.ddd.dal.condition.*;
import com.chuangjiangx.member.score.ddd.dal.dto.*;
import com.chuangjiangx.member.score.ddd.query.dto.ScoreStreamDTO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.session.RowBounds;

import java.util.List;

public interface ScoreStreamDalMapper {

    /**
     * 积分明细列表总数统计
     */
    Integer countScoreStreamList(ScoreStreamCondition condition);

    /**
     * 积分明细列表
     */
    List<ScoreStreamList> queryScoreStreamList(ScoreStreamCondition condition, RowBounds rowBounds);

    /**
     * 当前会员积分明细列表总数统计-客户端
     */
    Integer countScoreStreamListForClient(ScoreStreamForClientCondition clientCondition);

    /**
     * 当前会员积分明细列表-客户端
     */
    List<ClientScoreStreamList> queryScoreStreamListForClient(ScoreStreamForClientCondition clientCondition, RowBounds rowBounds);

    /**
     * 根据id查询积分明细详情
     */
    ClientScoreStream queryScoreStreamById(@Param(value = "id") Long id);

    /**
     * 会员详情-积分账户-积分明细列表--商户平台
     */
    List<ScoreStreamForList> queryScoreStreamForList(ScoreStreamlForListCondition condition, RowBounds rowBounds);

    /**
     * 会员详情-积分账户-根据会员id查询积分--商户平台
     */
    ScoreValue queryScoreValueByMemberIdAndMerchant(ScoreValueCondition condition);


    /**
     * 会员详情-积分账户总数-根据会员id查询积分--商户平台
     */
    Integer countScoreStreamListForMerchant(ScoreStreamListCondition condition);

    /**
     * 当前会员积分明细列表-商户平台
     */
    List<ScoreStreamForMerchant> queryScoreStreamListForMerchant(ScoreStreamListCondition condition, RowBounds rowBounds);

    /**
     * 当前会员积分明细列表-商户平台
     */
    List<ScoreStreamForMerchant> queryScoreStreamListAll(ScoreStreamListCondition condition);

//    /**
//     * 根据订单号查询积分详情信息
//     */
//    List<ScoreStreamByOrderNum> queryScoreStreamByOrderNum(ScoreStreamByOrderNumCondition condition);

    /**
     * 根据会员id查询时间
     */
    List<ScoreStreamByMemberId> queryScoreStreamByMemberId(@Param(value = "memberId") long memberId, @Param(value = "merchantId") long merchantId);

    MemberScoreInfo getMemberThisTimeScoreInfo(@Param("payOrderNumber") String payOrderNumber,@Param("mbrScoreType") Integer mbrScoreType);

    MemberScoreInfo queryPayScoreInfoByRefundOrderNum(@Param("refundOrderNum") String refundOrderNum);

    /**
     * 根据退款单号查询积分流水
     * @param refundNumberList
     * @return
     */
    List<ScoreStreamDTO> queryScoreStreamWithRefundNumberList(List<String> refundNumberList);


    Integer countMbrScoreStreamList(QueryMbrScoreStreamCondition condition);
    /**
     * 通用的查询积分流水列表-可分页
     */
    List<MbrScoreStreamList> queryMbrScoreStreamList(QueryMbrScoreStreamCondition condition);
}
